package com.eightgroups.tces.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.eightgroups.tces.entity.Clazz;
import com.eightgroups.tces.entity.ClazzVo;
import com.eightgroups.tces.mapper.ClazzMapper;
import com.eightgroups.tces.service.IClazzService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 班级表 服务实现类
 * </p>
 *
 * @author zzc2016.cn
 * @since 2017-11-03
 */
@Service
public class ClazzServiceImpl extends ServiceImpl<ClazzMapper, Clazz> implements IClazzService {

    @Autowired
    private ClazzMapper clazzMapper;
    @Override
    public Page<ClazzVo> selectByDept(Page<ClazzVo> page, EntityWrapper<ClazzVo> entityWrapper) {
        if (null != entityWrapper) {
            entityWrapper.orderBy(page.getOrderByField(), page.isAsc());
        }
        page.setRecords(clazzMapper.selectByDept(page, entityWrapper));
        return page;
    }
}
